package com.jy.servlet;

import com.alibaba.fastjson.JSON;
import com.jy.service.Orderservice;
import com.jy.service.impl.OrderSericelmpl;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.io.IOException;

public class orderList_orderDatail extends HttpServlet {
    private static final Logger log = LoggerFactory.getLogger(orderList_orderDatail.class);
    private Orderservice orderservice;

    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        String ordernumber = request.getParameter("orderList_ordernumber");

        if (ordernumber.trim() != ""){
            //把当前订单传到订单详情页面
            HttpSession session = request.getSession();
            session.setAttribute("orderList_ordernumber", ordernumber);

            request.getRequestDispatcher("/orderDetail.jsp").forward(request,response);
        }else {
            request.getRequestDispatcher("/orderList.jsp").forward(request,response);
        }
    }
}
